package com.example.traning.mall.controller.content;

import com.example.traning.mall.framework.common.pojo.PageParam;
import com.example.traning.mall.framework.common.pojo.R;
import com.example.traning.mall.service.content.IContentCategoryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import lombok.RequiredArgsConstructor;

/**
 * <p>
 * 内容-类别 前端控制器
 * </p>
 *
 * @author Lei Yu
 * @since 2025-04-29
 */
@Tag(name = "1. 类别管理")
@RequiredArgsConstructor
@RestController
@RequestMapping("/categories")
public class ContentCategoryController {

    private final IContentCategoryService service;


    @GetMapping
    @PreAuthorize("hasAuthority('/content/category/simple')")
    @Operation(summary = "查询类别列表")
    public R selectPage(PageParam pageParam) {
        return R.ok(service.selectPage(pageParam));
    }

}
